﻿@{
    ViewData["Title"] = "iBoxDB";

    DateTime begin = DateTime.Now;
}

@section Styles{
<style>
    body {
        margin-top: 10px;
        padding: 10px;
    }

    .grid {
        max-width: 100%;
        width: 100%;
        text-align: center;
    }

    .message {
        overflow-x: hidden;
    }

    .abw {
        word-wrap: break-word;
    }
</style>
}
<div class="grid">
    <div class="column">

        <h2 class="ui teal header">
            <i class="disk outline icon" style="font-size:82px"></i> Full Text Search Server
        </h2>
        <form class="ui large form" action="About" onsubmit="formsubmit()">
            <div class="ui label input">
                <div class="ui action input">
                    <input name="q" value="" onfocus="formfocus()" required dir="auto" />
                    <input id="btnsearch" type="submit" class="ui teal right button big" value="Search" />
                </div>
            </div>
        </form>
        <script>
            function formsubmit() {
                document.getElementById('btnsearch').disabled = "disabled";
            }
            function formfocus() {
                document.getElementById('btnsearch').disabled = undefined;
            }
        </script>

        <div class="ui message" style="text-align: left; font-size: 20px">
            <a href="Admin" target="ADMIN_FTSERVER">Add Page Index</a> <br>
            <br />
            @foreach (var t in IndexPage.getSearchTerm(10))
            {
                var str = t.keywords;
                if (str.Equals(IndexPage.SystemShutdown))
                {
                    continue;
                }
                @:<a href="About?q=@Html.Raw(System.Net.WebUtility.UrlEncode(str))">[@str]</a> &nbsp;
            }



            <br /><br /><a href="./">Refresh Discoveries</a>:&nbsp; <br />
            @foreach (String str in IndexPage.discover())
            {
                @:<a href="About?q=@Html.Raw(System.Net.WebUtility.UrlEncode(str))">[@str]</a> &nbsp;
            }
            <br>
            <br>
        </div>
        Load Time: @((DateTime.Now - begin).TotalSeconds) s
    </div>
</div>
